<template>
  <el-container>
    <el-header>
      <div class="menus">
        <el-menu
          :default-active="activeIndex"
          :router="true"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          class="el-menu-demo"
          mode="horizontal"
        >
          <el-menu-item index="/adFrontpage"
            >首页</el-menu-item
          >

          <el-menu-item index="/logisticsState"
            >物流管理</el-menu-item
          >
          
          <el-menu-item index="/logisticsTransfer"
            >物流中转站</el-menu-item
          >
              <div id="avatars">
      <el-avatar id="el-avatars" >user</el-avatar>
            <el-button type="primary" @click="logout">退出</el-button>
    </div>
        </el-menu>
        
      </div>
      <div class="line"></div>
    </el-header>
    <el-main
      ><div id="borderhome"><router-view></router-view></div>
    </el-main>
  </el-container>
</template>
<script>
import { LogOut } from "@/request/api";
export default {
  data() {
    return {
      activeIndex: "/adFrontpage",
    };
  },
  methods: {
    logout() {
      LogOut().then((res) => {
        console.log(res.data);
        this.$router.push({
          path: "/login",
        });
      });
    },
  },
};
</script>
<style>
.el-header {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 30px;
}
a {
  text-decoration: none;
}

.router-link-active {
  text-decoration: none;
}
#borderhome {
  border-radius: 2px;
  max-width: 80%;
  background-color: white;
  margin: 0 auto;
}
#avatars{
  position:absolute;
  right: 10px;

}
#el-avatars {
overflow: inherit;
}
</style>